package com.frank.loadinglibrary.common;

import ohos.agp.components.AttrSet;
import ohos.app.Context;


/**
 * @author : frank
 * @date : 2021/4/29 16:19
 */
public abstract class BallLoadingComponent<T extends BaseLoadingComponent> extends BaseLoadingComponent {

    protected boolean enableRotationAnimator = false;

    private int ballCount = 10;

    protected String[] colorPalette;

    public T setColorPalette(String[] colorPalette) {
        this.colorPalette = colorPalette;
        return (T) this;
    }

    public T setBallCount(int ballCount) {
        this.ballCount = ballCount;
        return (T) this;
    }

    public T setEnableRotationAnimator(boolean enableRotationAnimator) {
        this.enableRotationAnimator = enableRotationAnimator;
        return (T) this;
    }

    public BallLoadingComponent(Context context) {
        super(context);
    }

    public BallLoadingComponent(Context context, AttrSet attrSet) {
        super(context, attrSet);
    }

    public BallLoadingComponent(Context context, AttrSet attrSet, String styleName) {
        super(context, attrSet, styleName);
    }

    public BallLoadingComponent(Context context, AttrSet attrSet, int resId) {
        super(context, attrSet, resId);
    }


    public int getBallCount() {
        return ballCount;
    }
}
